first_weekday is relative to week_1stday, not to Sunday. Gotta love the
authorMatthias Clasen <mclasen@redhat.com>
Fri, 9 Sep 2005 17:26:14 +0000 (17:26 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 9 Sep 2005 17:26:14 +0000 (17:26 +0000)
2005-09-09  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkcalendar.c (gtk_calendar_init): first_weekday is relative
to week_1stday, not to Sunday. Gotta love the ISO 14652 guys...
(#314473, Stanislav Brabec)

ChangeLog
ChangeLog.pre-2-10
gtk/gtkcalendar.c

index 603f0bc27b9c2f0405fff1407afdd324793dd7c2..b45ff6fcb61174958a65dbeaafd955c993c973e0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-09-09  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkcalendar.c (gtk_calendar_init): first_weekday is relative
+       to week_1stday, not to Sunday. Gotta love the ISO 14652 guys...
+       (#314473, Stanislav Brabec)
+
 2005-09-09  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_get_visible_range): Document
index 603f0bc27b9c2f0405fff1407afdd324793dd7c2..b45ff6fcb61174958a65dbeaafd955c993c973e0 100644 (file)
@@ -1,3 +1,9 @@
+2005-09-09  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkcalendar.c (gtk_calendar_init): first_weekday is relative
+       to week_1stday, not to Sunday. Gotta love the ISO 14652 guys...
+       (#314473, Stanislav Brabec)
+
 2005-09-09  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_get_visible_range): Document
index f1ecd1d48041cf37b61aad7b1356b0f3ab524b86..7cb668a81642122f3575f742effd25998142bb40 100644 (file)
@@ -565,8 +565,9 @@ gtk_calendar_init (GtkCalendar *calendar)
   time_t tmp_time;
   GtkCalendarPrivate *priv;
   gchar *year_before;
-  gchar *week_start;
-  
+  gchar *week_start, week_startsub = 1;
+  guint week_origin;
+
   priv = calendar->priv = G_TYPE_INSTANCE_GET_PRIVATE (calendar,
                                                       GTK_TYPE_CALENDAR,
                                                       GtkCalendarPrivate);
@@ -652,7 +653,15 @@ gtk_calendar_init (GtkCalendar *calendar)
 
 #ifdef HAVE__NL_TIME_FIRST_WEEKDAY
   week_start = nl_langinfo (_NL_TIME_FIRST_WEEKDAY);
-  priv->week_start = (*((unsigned char *) week_start) - 1) % 7;
+  week_origin = GPOINTER_TO_INT (nl_langinfo (_NL_TIME_WEEK_1STDAY));
+  if (week_origin == 19971130)
+    week_startsub = 0;
+  else if (week_origin == 19971201)
+    week_startsub = 1;
+  else
+    g_warning ("Unknown value of _NL_TIME_WEEK_1STDAY.\n");
+
+  priv->week_start = (*((unsigned char *) week_start) - week_startsub) % 7;
 #else
   /* Translate to calendar:week_start:0 if you want Sunday to be the
    * first day of the week to calendar:week_start:1 if you want Monday
@@ -2169,8 +2178,11 @@ calendar_paint_day (GtkCalendar *calendar,
       
       gtk_paint_focus (widget->style, 
                       priv->main_win,
+                      state,
+#if 0
                       (calendar->selected_day == day) 
                          ? GTK_STATE_SELECTED : GTK_STATE_NORMAL, 
+#endif
                       NULL, widget, "calendar-day",
                       day_rect.x,     day_rect.y, 
                       day_rect.width, day_rect.height);